package com.yiwyn.ood.capr;

public class CAPRBadDemo {

    public static void main(String[] args) {

        Car car = new BlueElectronicCar();

        car.carInfo();

    }


    static class Car {
        public void carInfo() {
            System.out.println("一个车");
        }
    }


    static class RedCar extends Car {
        @Override
        public void carInfo() {
            System.out.println("一个红色的车");
        }
    }

    static class RedElectronicCar extends Car {
        @Override
        public void carInfo() {
            System.out.println("一个红色的电车");
        }
    }

    static class BlueElectronicCar extends Car {
        @Override
        public void carInfo() {
            System.out.println("一个蓝色的电车");
        }
    }


}
